package com.gitee.openviducn.inspector.config;

import com.gitee.openviducn.inspector.auth.AuthService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @Author: https://gitee.com/wesleyOne
 * @Date: 04.19 2020
 */
@Component
public class UserManager {

    @Resource
    private AuthService<HttpServletRequest> authService;

    public AuthService.AuthUser getUser(HttpServletRequest request) {
        AuthService.AuthUser authUser = authService.getAuthUser(request);
        if (authUser == null) {
            return null;
        }
        return authUser;
    }
}
